﻿@using Resources
@{
    Layout = "~/Views/Shared/_SimpleLayout.cshtml";
}
<div>
        请先下载模板文件，并按照模板格式导入:
        @Html.ActionLink("下载摸板", "DownLoadTemplete", null, new { @class = "commonButton", id = "lkDownload" })
    </div>
<div>
    @using (Html.BeginForm("Import", "QQMonitor", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
        @Html.ValidationSummary()
        <table>
            <tr>
                <td>QQ信息薄:</td>
                <td>
                    <input name="qqListFile" id="qqListFile" type="file" value="选择需要导入的文件(.csv)" />
                </td>
            </tr>
        </table>
        <div class="buttonsContain controlBottom">
            <ul class="rightContain">
                <li>
                    <input id="btnSubmit" type="submit" value="@Resource.Button_Import"/>
                </li>
            </ul>
        </div>
    }
</div>
@section css
{
    <style type="text/css">
        #lkDownload {
            display: inline-block;
        }
    </style>
}
@section javascript
{
    <script type="text/javascript">
        $(document).ready(function() {
            $("#btnSubmit").bind("click", function() {
                var path = $("#qqListFile").val();
                if (path == undefined || path == "") {
                    alert("请先下载模板XML文件，并选择需要导入的XML后缀文件");
                    return false;
                }
                var exts = path.substring(path.indexOf('.'));
                if (exts != ".csv") {
                    alert("请先下载模板XML文件，并按照导入的样板格式！");
                    return false;
                }
            });
        });
    </script>
}

